<include file="public@header" />
</head>
<body>
    <div class="layui-fluid js-check-wrap">
        <div class="layui-card">
            <div class="layui-card-header">
                <h3>回复时间统计</h3>
            </div>
            <div class="layui-card-body">
                <form class="form-search layui-form layui-form-item clearfix" action="{:url('AdminMessage/timecount')}">
                    <div class="layui-col-md11 layui-col-sm10">
                        <div class="layui-inline">
                            <select class="layui-input" name="sort_id">
                                <option value="0">请选择类型 </option>
                                <foreach name="sort" item="vo" key='k'>
                                <option value="{$k}" <if condition="input('sort_id') eq $k">selected</if> >{$vo}</option>
                                </foreach>
                            </select>
                        </div>
                        <div class="layui-inline">
                            <select class="layui-input" name="admin_user">
                                <option value="0">请选择回复人员</option>
                                <foreach name="admin_user" item="vo" key='k'>
                                <option value="{$k}" <if condition="input('admin_user') eq $k">selected</if> >{$vo}</option>
                                </foreach>
                            </select>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">{:lang('TIME')}:</label>
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input js-layui-date" name="start_time"
                                    <if condition="input('start_time') neq ''">value="{:input('start_time')}"
                                    <else/>
                                    value="{:date('Y-m-d',$between['start'])}"
                                    </if>
                                       style="width: 100px;" autocomplete="off">
                            </div>
                            <div class="layui-form-mid">-</div>
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input js-layui-date" name="end_time"
                                    <if condition="input('end_time') neq ''">value="{:input('end_time')}"
                                    <else/>
                                    value="{:date('Y-m-d',$between['end'])}"
                                    </if>
                                       
                                       style="width: 100px;" autocomplete="off">
                            </div>                    
                        </div>
                        <div class="layui-inline">
                            <input type="submit" class="layui-btn layui-btn-normal" value="{:lang('SEARCH')}"/>
                            <a class="layui-btn layui-btn-danger" href="{:url('AdminMessage/export',array('start_time'=>input('start_time'),'end_time'=>input('end_time'),'sort_id'=>input('sort_id'),'admin_user'=>input('admin_user')))}" >导出统计</a>
                        </div>
                        <!-- <a class="layui-btn layui-btn-danger layui-btn-sm" href="{:url('AdminArticle/index')}">清空</a> -->


                       <!--  <if condition="cmf_auth_check(cmf_get_current_admin_id(), 'portal/adminarticle/export')">
                            <div class="layui-inline">
                                <a class="layui-btn layui-btn-danger" href="{:url('AdminArticle/export',array('start_time'=>$start_time,'end_time'=>$end_time,'keyword'=>$keyword,'category'=>$category))}" >导出点击量统计</a>
                            </div>
                        </if> -->

                    </div>
                </form>
            </div>

            <div class="layui-card-body">
                <table class="layui-table" >
                    <thead>
                        <tr>
                            <!-- <th width="50">ID</th> -->
                            <th>类型</th>
                            <th>回复人员</th>
                            <foreach name="timeman" item="v">
                                <th>{$v['time']}小时</th>
                            </foreach>
                            <th>其他时间</th>
                            <th>未回复</th>
                        </tr>
                    </thead>
                    <tbody>
                        <foreach name="data" item="vo">
                        <if condition="$vo['count'] neq 0">
                            <tr>
                                <!-- <td>{$vo.id}</td> -->
                                <td>{$sort[$vo.type]}</td>
                                <td>{$admin_user[$vo.reply_user_id]}</td>
                                <!-- <td>{:date('Y-m-d H:i:s',$vo['time'])}</td> -->
                                <volist name="timeman" id="v" key="k">

                                    <td>{:round($vo[$v['time']]/$vo['count'],2)*100}%</td>
                                </volist>
                                <td>{:round($vo['else']/$vo['count'],2)*100}%</td>
                                <td>{:round($vo['noreply']/$vo['count'],2)*100}%</td>
                            </tr>
                        </if>
                        </foreach>
                    </tbody>
                </table>
                <div class="pages">{$page|default=''}</div>
            </div>
        </div>        
    </div>

<include file="public@footer"/>
